home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- struct country c_info;
-
- /* Get date, time and currency format for
- * current country */
- country(0, &c_info);
- /* Display the information */
- printf("=============== For this country ===============\n");
- printf("Date is of the form: ");
- switch(c_info.co_date)
- {
- case 0:
- printf("MM%sDD%sYY\n", c_info.co_dtsep,
- c_info.co_dtsep);
- break;
- case 1:
- printf("DD%sMM%sYY\n", c_info.co_dtsep,
- c_info.co_dtsep);
- break;
- case 2:
- printf("YY%sMM%sDD\n", c_info.co_dtsep,
- c_info.co_dtsep);
- break;
- }
- printf("Time is of the form: HH%sMM%sSS\n",
- c_info.co_tmsep, c_info.co_tmsep);
- printf("Currency style: ");
- switch(c_info.co_currstyle)
- {
- case 0:
- printf("%s9%s999%s99\n", c_info.co_curr,
- c_info.co_thsep, c_info.co_desep);
- break;
- case 1:
- printf("9%s999%s99%s\n", c_info.co_thsep,
- c_info.co_desep, c_info.co_curr);
- break;
- case 3:
- printf("%s 9%s999%s99\n", c_info.co_curr,
- c_info.co_thsep, c_info.co_desep);
- break;
- case 4:
- printf("9%s999%s99 %s\n", c_info.co_thsep,
- c_info.co_desep, c_info.co_curr);
- break;
- }
- }